/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;

/**
 *
 * @author NS
 */
public class List_Profile {
    private Connection conn = null;
    public List_Profile(Connection conn){
        this.conn = conn;
    }
    public ArrayList<String> profileList(){
        Statement stmt;
        ArrayList<String> lst = null;
        try{
            stmt = conn.createStatement();
            System.out.println("SELECT DISTINCT PROFILE FROM SYS.DBA_PROFILES");
            ResultSet rs = stmt.executeQuery("SELECT DISTINCT PROFILE FROM DBA_PROFILES");
            lst = new ArrayList<String>();
            while(rs.next()){
                lst.add(rs.getString(1));
            }
        }catch(SQLException e){
            System.out.println(e);
        }
        return lst;
    }
}
